﻿using MiniFox.Components;
using MiniFox.Infrastructure;
using MiniFox.Platform.File.Models;
using MiniFox.Platform.File.Services.Impls;

namespace MiniFox.Platform.File.Services
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister, SpareComponent(typeof(DefaultFileService))]
    public interface IFileService
    {
        /// <summary>
        /// 
        /// </summary>
        string Group { get; }
        /// <summary>
        /// 
        /// </summary>
        string RouteName { get; }
        /// <summary>
        /// 
        /// </summary>
        bool PreDownload { get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        FileData Load(string fileId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        Task<FileData> LoadAsync(string fileId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileIds"></param>
        /// <returns></returns>
        IEnumerable<FileData> LoadBatch(string[] fileIds);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileIds"></param>
        /// <returns></returns>
        Task<IEnumerable<FileData>> LoadBatchAsync(string[] fileIds);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileIds"></param>
        /// <returns></returns>
        IEnumerable<FileData> Query(string[] fileIds);
        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="folderId"></param>
        ///// <returns></returns>
        //IEnumerable<FileData> Query(string folderId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="path"></param>
        /// <param name="top"></param>
        /// <returns></returns>
        FileData[] GetFiles(string path, int? top);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="queryObject"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<FileData>> Query(PagedQueryObject<FileQuery> queryObject);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileDatas"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        ZipFileData CreateZip(IEnumerable<FileData> fileDatas, string fileName);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileDatas"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        Task<ZipFileData> CreateZipAsync(IEnumerable<FileData> fileDatas, string fileName);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        void CheckFileAvaliable(CheckFileRequest request);
    }

}
